// Copyright (c) 2021 Presto Labs Pte. Ltd.
// Author: fengyang

#pragma once

#include <iomanip>
#include <sstream>
#include <string>

#include "coin2/base/time.h"
#include "coin2/exchange/feed.pb.h"

namespace coin2::exchange::base::feed_util {
struct Index {
  int64_t timestamp;
  double price;

  void Clear() {
    timestamp = 0;
    price = 0;
  }
};

inline std::ostream& operator<<(
    std::ostream& os,
    const Index& index) {
  os << "Index ";
  os << "(price=";
  os << std::setw(15);
  os << index.price;
  os << ")";
  return os;
}
}  // namespace coin2::exchange::base::feed_util